import { defineStore } from "pinia";
import { shallowRef, reactive } from "vue";
import { StudentApi } from "@/api";
import { stringifyExpression } from "@vue/compiler-core";

export default defineStore("student", () => {
    const list = reactive<Array<HttpPayload.StudentAvatar>>([])
    const add = async (model: HttpPayload.StudentAvatar) => {
        const stu_id = await StudentApi.add(model)
        list.push({ ...model, stu_id })
    }
    const pagination = reactive({
        currentPage: 1,
        pageSize: 6,
        total: 0,
    })
    const search = reactive({
        stu_name:string,
    });
    return { list,pagination,search }
})